import request from '@/utils/request'

export function roles(pageSize,page,search) {
  return request({
    url: `/api/crm/roles?size=${pageSize}&current=${page}${search}`,
    method: 'get'
  })
}


// 获取权限列表
export function lazy(pid) {
  return request({
    url: `/api/crm/menus/lazy?pid=${pid}`,
    method: 'get'
  })
}

//修改权限
export function menu(form) {
  return request({
    url: `/api/crm/roles/menu`,
    method: 'put',
    data:form
  })
}


export function addRoles(type, form) {
  return request({
    url: `/api/crm/roles`,
    method: type,
    data:form
  })
}